package Singleton;

public class Client {
    public static void main(String[] args) {
        MyFruit fruit1,fruit2;
        fruit1 = new Apple();
        fruit2 = new Banana();

        MyFruitStore store1 = MyFruitStore.getInstance();

        store1.add(1,fruit1);
        store1.add(2,fruit2);
        store1.add(3,new Apple());
        store1.add(4,new Banana());


        MyFruit fruit = (MyFruit) store1.get(3);
        fruit.display();

        MyFruitStore store2 = MyFruitStore.getInstance();
        System.out.println("store1" + store1.toString());
        System.out.println("store2" + store2.toString());
        System.out.println(store1.equals(store2));


    }


}
